import request from '@/utils/request'

// 分页查询楼栋
export function listBan(query) {
  return request({
    url: '/spaceBan/page',
    method: 'get',
    params: query
  })
}

// 根据楼栋ban_id查询楼栋
export function getBan(banId) {
  return request({
    url: '/spaceBan/selectById',
    method: 'get',
    params: { banId }
  })
}

// 添加楼栋
export function addBan(data) {
  return request({
    url: '/spaceBan/add',
    method: 'post',
    data: data
  })
}

// 修改楼栋
export function updateBan(data) {
  return request({
    url: '/spaceBan/update',
    method: 'put',
    data: data
  })
}

// 删除楼栋
export function delBan(banId) {
  return request({
    url: '/spaceBan/delete/' + banId,
    method: 'delete'
  })
}

export function exportBan() {
  return request({
    url: "/spaceBan/exportData",
    method: "get",
    responseType: "blob",
  });
}


